/**
 * Copyright (C), 2020, 安徽贝慕信息科技有限公司
 * FileName: DealerCompanyController
 * Author:   Allen
 * Date:     2020/8/27 16:58
 * Description: 商家基本信息登记处理Controller
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.bim.marvel.rest;

import com.bim.marvel.openapi.client.dto.DealerCompanyDTO;
import com.bim.marvel.openapi.client.query.DealerCompanyQuery;
import com.bim.marvel.common.core.model.dto.SimpleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * 〈商家基本信息登记处理Controller〉
 *
 * @author Allen
 * @date 2020/8/27
 * @since 1.0.0
 */
@Api(tags = {"商家基本信息登记处理-controller"})
@RequestMapping("/api/dealer/company")
public interface DealerCompanyController {

    /**
     * 保存商家申请接入的基本信息请求URL
     */
    String DEALER_COMPANY_SAVE_URL = "/save";

    /**
     * 获得商家申请接入的基本信息请求URL
     */
    String GET_DEALER_COMPANY_URL = "/byId/{companyId}";


    /**
     * 保存商家申请接入的基本信息
     * @param dealerCompanyQuery 商家申请接入的基本信息入参
     * @return 返回商家编号，用于前端带入到下一个环节申请接入应用号使用
     */
    @ApiOperation(value = "保存商家申请接入的基本信息", notes = "保存商家申请接入的基本信息",
            protocols = "http,https", httpMethod = "POST")
    @PostMapping(value = DEALER_COMPANY_SAVE_URL, consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE},
            produces = {MediaType.APPLICATION_JSON_VALUE})
    SimpleVO<String> saveDealerCompany(@Valid DealerCompanyQuery dealerCompanyQuery);

    /**
     * 获得商家申请接入的基本信息
     * @param companyId 商家编号
     * @return 返回商家信息
     */
    @ApiOperation(value = "获得商家申请接入的基本信息", notes = "获得商家申请接入的基本信息",
            protocols = "http,https", httpMethod = "GET")
    @GetMapping(value = GET_DEALER_COMPANY_URL, consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE},
            produces = {MediaType.APPLICATION_JSON_VALUE})
    SimpleVO<DealerCompanyDTO> getDealerCompany(@ApiParam(name = "companyId", value = " 商家编号", required = true)
                                      @RequestParam("companyId") String companyId);
}
